package ecommerce.util;

import java.util.logging.FileHandler;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.logging.SimpleFormatter;

public class EcommerceLog {
    private static Logger log = null;
    private static FileHandler fh = null;
    
    private EcommerceLog() {
    }
    
    static{
        try{
            log = Logger.getLogger("Ecommerce");
            fh = new FileHandler("/home/hezuo/Desktop/log.log", true);
            fh.setFormatter(new SimpleFormatter());
            log.setLevel(Level.ALL);
            log.addHandler(fh);
        }catch(Exception e){            
        }
    }    
    public static void info(String msg) {
        log.info(msg);
    }
    public static void error(Exception e) {
        log.log(Level.ALL, "Ecommerce", e); 
     }
}
